package www.dianbaozu.com.ui.my

import androidx.hilt.lifecycle.ViewModelInject
import www.wen.com.common.lib.base.module.BaseAbsViewModel
import www.wen.com.common.lib.data.entities.ProtocolEntity
import www.wen.com.common.lib.data.entities.Result
import www.wen.com.common.lib.data.repository.AppDataManager

class HelpCenterViewModel @ViewModelInject constructor(appDataManager: AppDataManager) :
        BaseAbsViewModel<ProtocolEntity, ProtocolEntity.Content>(appDataManager) {

    override suspend fun requestListData(requiredParameter: Any): Result<ProtocolEntity> =
            appDataManager.requestProtocol(mapOf("type" to "帮助中心","page" to mPage.toString(), "size" to mLimit.toString()))

    override fun dataConversion(data: ProtocolEntity): List<ProtocolEntity.Content> {
        val dates = mutableListOf<ProtocolEntity.Content>()
        data.content.forEach {
            if(it.enableStatus){
                dates.add(it)
            }
        }
        return dates
    }

}